package domena;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;


@Entity
@Table(name="UPRAWNIENIA")
public class Uprawnienie {
	private long id;
	private String login;
	private Set<User> user = new HashSet<User>(
			0);
	
	@Id
	@Column(name="ID_UPRAWNIENIE", unique = true, nullable = true)
	@GeneratedValue(strategy = IDENTITY)
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	@Column(name="LOGIN")
	public String getLogin() {
		return login;
	}
	public void setLogin(String login) {
		this.login = login;
	}
	
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "uprawnienie")
	public Set<User> getUser() {
		return this.user;
	}
	public void setUser(Set<User> user) {
		this.user = user;
	}
	
}
